﻿using System;
using System.Text;

namespace Gadgeteer.Modules.Community.XBee
{
    /// <summary>
    /// Common Hex values for XBee messages
    /// </summary>
    public enum APIMessageEnum : ushort
    {
        /// <summary>
        /// Used by TransmitStatus and other message to indicate OK
        /// </summary>
        OK = 0x00,
        /// <summary>
        /// Used by TransmitStatus and other message to indicate Error
        /// </summary>
        ERROR = 0x01,
        /// <summary>
        /// Used by TransmitStatus to indicate that the command is not valid
        /// </summary>
        InvalidCommand = 0x02,
        /// <summary>
        /// Used by TransmitStatus to indicate that the parameter is incorrect
        /// </summary>
        InvalidParameter = 0x03,
        /// <summary>
        /// Used by TransmitStatus to indicate an error in transmission
        /// </summary>
        TxFailure = 0x04,
        /// <summary>
        /// The start delimiter of all API messages
        /// </summary>
        StartDelimiter = 0x7E,
        /// <summary>
        /// An AT Response message identifier
        /// </summary>
        ATResponse = 0x88,
        /// <summary>
        /// An AT Command message identifier
        /// </summary>
        ATCommand = 0x08,
        /// <summary>
        /// An AT Transmit Request identifier
        /// </summary>
        TransmitRequest = 0x10,
        /// <summary>
        /// A Transmit Status message identifier
        /// </summary>
        TransmitStatus = 0x8B,
        /// <summary>
        /// A Transmit Receive message identifier
        /// </summary>
        TransmitReceive = 0x90,
        /// <summary>
        /// The following byte is escaped
        /// </summary>
        EscapedByte = 0x7D,
        /// <summary>
        /// Not part of the XBee protocol, this is a special message type special to XBeeClient
        /// </summary>
        MultiPartMessage = 0x7C,

    }
}
